var status = 0;
var mapid = 922010900;

function start() {
 status = -1;
 action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0) {
			cm.sendOk("OK then, see you next time!");
   			cm.dispose();
   			return;
  		}
		if (mode == 1)
   			status++;
  		else
   			status--;
  		if (status == 0) {
			if (cm.getChar().getMapId() != mapid) {
				cm.sendYesNo("Do you want to have a Great Battle and free the world of maplestory?\r\n#rMake sure to gather 15 friends#k");
			} else {
			cm.sendYesNo("I can spawn a boss with 1bil hp for you\r\nThis can only be used with 15 persons in this map\r\nDo you want to spawn her?\r\n(Warning, when used when theres already a boss, the old boss will die and you will NOT get exp");
			}
		} else {
			if (cm.getChar().getMapId() != mapid) {
				cm.warp(mapid);
				cm.dispose();
			} else {
				if (cm.getCharQuantity(mapid) >= 15) {
					//cm.getC().getPlayer().getMap().killMonster(8220003, cm.getChar(), true);
					cm.spawnMob(8220003, 1000000000, 1000, 1, 10000000, 0, 0, 1, 0, 0);
					//cm.startEvent(mapid);
					cm.mapMessage("Have fun being dead!");
					cm.dispose();
				} else {
					cm.sendOk("There aren't enough players in the map");
					cm.dispose();
				}
			}
		}
	}
}